home *** CD-ROM | disk | FTP | other *** search
/ STraTOS 1997 April & May / STraTOS 1 - 1997 April & May.iso / CD01 / INTERNET / BROWSERS / GLUESTIK.ZOO / drivers.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-12-16  |  2.3 KB  |  72 lines

  1. /*      drivers.h        (c) Steve Adam 1995   steve@netinfo.com.au
  2.  *
  3.  *      Data types etc. for access to STiK TCP/IP drivers.
  4.  *
  5.  *      Modified 12/16/95 for MiNTlib compatibility --sb
  6.  */
  7.  
  8. #ifndef STIK_DRIVERS_H
  9. #define STIK_DRIVERS_H
  10.  
  11. #ifndef COMPILER_H
  12. #include <compiler.h>
  13. #endif
  14.  
  15. /*  Data types used throughout STiK  */
  16.  
  17. typedef int int16;
  18. typedef unsigned int uint16;
  19. typedef long int32;
  20. typedef unsigned long uint32;
  21.  
  22. #ifndef TRUE
  23. #define TRUE    1
  24. #endif
  25. #ifndef FALSE
  26. #define FALSE   0
  27. #endif
  28.  
  29. /* STIK global configuration structure */
  30. typedef struct config {
  31.     uint32  client_ip;          /*  IP address of client (local) machine    */
  32.     uint32  provider;           /*  IP address of provider, or 0L           */
  33.     uint16  ttl;                /*  Default TTL for normal packets          */
  34.     uint16  ping_ttl;           /*  Default TTL for `ping'ing               */
  35.     uint16  mtu;                /*  Default MTU (Maximum Transmission Unit) */
  36.     uint16  mss;                /*  Default MSS (Maximum Segment Size)      */
  37.     uint16  df_bufsize;         /*  Size of defragmentation buffer to use   */
  38.     uint16  rcv_window;         /*  TCP receive window                      */
  39.     uint16  def_rtt;            /*  Initial RTT time in ms                  */
  40.     int16   time_wait_time;     /*  How long to wait in `TIME_WAIT' state   */
  41.     int16   unreach_resp;       /*  Response to unreachable local ports     */
  42.     int32   cn_time;            /*  Time connection was made                */
  43.     int16   cd_valid;           /*  Is Modem CD a valid signal??            */
  44. } CONFIG;
  45.  
  46.  
  47. /* Driver access structure/functions    */
  48. #define MAGIC   "STiKmagic"
  49. #define CJTAG   "STiK"
  50.  
  51. typedef struct drv_header {     /* ptr to header part of driver struct  */
  52.     char *module;
  53.     char *author;
  54.     char *version;
  55. } DRV_HDR;
  56.  
  57. typedef struct drv_list {
  58.     char magic[10];                         /* Magic number.  To be decided */
  59.     DRV_HDR * __CDECL (*get_dftab)(char *);   /* Get Driver Function Table fn */
  60.     int16     __CDECL (*ETM_exec)(char *);    /* Execute a STiK module        */
  61.     CONFIG    *cfg;
  62. } DRV_LIST;
  63.  
  64. extern DRV_LIST *drivers;
  65.  
  66. #define get_dftab(x)    (*drivers->get_dftab)(x)
  67. #define ETM_exec(x)     (*drivers->ETM_exec)(x)
  68. #define stik_cfg        (drivers->cfg)
  69.  
  70.  
  71. #endif   /* STIK_DRIVERS_H */
  72.